<div class="action-dialog-model-fixed-body">
<div class="detailsBox">
 <p class="p10">财务审核信息</p>
<form action="<@url value='/workflowsubmit/zx_ptcw'/>" class="action-ajax-form" method="POST">
		<div class="dataBable action-pagination-table">
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="b_t_e5">
				<thead>
					<tr>
						<th>NO.</th>
						<th>年月</th>
						<th>提货金额（元）</th>
						<th>回款金额（元）</th>
						<th>应收账款（元）</th>
					</tr>
				</thead>
				<tbody>
					<tr>
					<input type="hidden" value="${o2oSd.id}" name="id"/>
					<input type="hidden" value="${zXPTCWForm.referId}" name="loanapplyNo"/>
						<td>1</td>
						<td>${o2oSd.firstMonth}</td>
						<td><input class="tabInp"  onchange="onchangeTakeAmount();" type="text" name="firstTakeAmount" value="${o2oSd.firstTakeAmount}" id="firstTakeAmount"/></td>
						<td><input class="tabInp"   onchange="onchangePaymentAmount();"  type="text" name="firstPaymentAmount" value="${o2oSd.firstPaymentAmount}" id="firstPaymentAmount"/></td>
						<td><input type="text" class="bn tabInp" name="firstRecAmount" value="${o2oSd.firstRecAmount}" id="firstRecAmount" readonly="readonly"/></td>
					</tr>
					<tr class="bg">
						<td>2</td>
						<td>${o2oSd.secondMonth}</td>
						<td><input class="tabInp"  onchange="onchangeTakeAmount();" type="text" name="secondTakeAmount" value="${o2oSd.secondTakeAmount}" id="secondTakeAmount"/></td>
						<td><input class="tabInp"   onchange="onchangePaymentAmount();" type="text" name="secondPaymentAmount" value="${o2oSd.secondPaymentAmount}" id="secondPaymentAmount"/></td>
						<td><input type="text" class="bn tabInp" name="secondRecAmount" value="${o2oSd.secondRecAmount}" id="secondRecAmount" readonly="readonly"/></td>
					</tr>
					<tr>
						<td>3</td>
						<td>${o2oSd.thirdMonth}</td>
						<td><input class="tabInp" onchange="onchangeTakeAmount();" type="text" name="thirdTakeAmount" value="${o2oSd.thirdTakeAmount}" id="thirdTakeAmount"/></td>
						<td><input class="tabInp"  onchange="onchangePaymentAmount();" type="text" name="thirdPaymentAmount" value="${o2oSd.thirdPaymentAmount}" id="thirdPaymentAmount"/></td>
						<td><input type="text" class="bn tabInp" name="thirdRecAmount" value="${o2oSd.thirdRecAmount}" id="thirdRecAmount" readonly="readonly"/></td>
					</tr>
					<tr class="bg">
						<td>4</td>
						<td>${o2oSd.fourthMonth}</td>
						<td><input class="tabInp" onchange="onchangeTakeAmount();" type="text" name="fourthTakeAmount" value="${o2oSd.fourthTakeAmount}" id="fourthTakeAmount"/></td>
						<td><input class="tabInp" onchange="onchangePaymentAmount();" type="text" name="fourthPaymentAmount" value="${o2oSd.fourthPaymentAmount}" id="fourthPaymentAmount"/></td>
						<td><input type="text" class="bn tabInp" name="fourthRecAmount" value="${o2oSd.fourthRecAmount}" id="fourthRecAmount" readonly="readonly"/></td>
					</tr>
					<tr>
						<td>5</td>
						<td>${o2oSd.fifthMonth}</td>
						<td><input class="tabInp"  onchange="onchangeTakeAmount();" type="text" name="fifthTakeAmount" value="${o2oSd.fifthTakeAmount}" id="fifthTakeAmount"/></td>
						<td><input class="tabInp"  onchange="onchangePaymentAmount();" type="text" name="fifthPaymentAmount" value="${o2oSd.fifthPaymentAmount}" id="fifthPaymentAmount"/></td>
						<td><input type="text" class="bn tabInp" name="fifthRecAmount" value="${o2oSd.fifthRecAmount}" id="fifthRecAmount" readonly="readonly"/></td>
					</tr>
					<tr class="bg">
						<td>6</td>
						<td>${o2oSd.sixthMonth}</td>
						<td><input class="tabInp"  onchange="onchangeTakeAmount();" type="text" name="sixthTakeAmount" value="${o2oSd.sixthTakeAmount}" id="sixthTakeAmount"/></td>
						<td><input class="tabInp"   onchange="onchangePaymentAmount();" type="text" name="sixthPaymentAmount" value="${o2oSd.sixthPaymentAmount}" id="sixthPaymentAmount"/></td>
						<td><input type="text" class="bn tabInp" name="sixRecAmount" value="${o2oSd.sixRecAmount}" id="sixRecAmount" readonly="readonly"/></td>
					</tr>
					<tr>
						<td>7</td>
						<td>月平均</td>
						<td><input id="takeAvgAmount" class="bn tabInp" type="text" name="takeAvgAmount" value="${o2oSd.takeAvgAmount}" readonly="readonly"/></td>
						<td><input id="paymentAvgAmount" class="bn tabInp" type="text" name="paymentAvgAmount" value="${o2oSd.paymentAvgAmount}" readonly="readonly"/></td>
						<td><input id="recAvgAmount" class="bn tabInp" type="text" name="recAvgAmount" readonly="readonly"/>--</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="detaiTab">
		<table width="100%" cellspacing="0" cellpadding="0" border="0"
			class="b_t_e5">
			<tbody>
				<tr>
					<td width="18%" align="right" class="bg"><span
						style="color: red;">*</span>与怡亚通（前身）合作开始时间:</td>
					<input type="hidden" class="tabInp" name="loanapplyno"
						value="${zXPTCWForm.loanapplyno}">
					<td width="35%"><@date value="${zXPTCWForm.eaTime}"
						id="eaCooperationDate" name = "eaTime"/></td>
					<td align="right" class="bg"><span style="color: red;">*</span>客户年销售额
						(元)</td>
					<td><input type="text" class="tabInp inputNum"
						name="customerSalesamount"
						value="${zXPTCWForm.customerSalesamount}"></td>
				</tr>
				<tr>
							<td class="bg" align="right" width="18%">特殊情况说明:</td>
							<td colspan="3"><textarea name="zxRemark" id="zxRemark" rows="4" cols="100"
									maxlength="2000" class="text">${zXPTCWForm.zxRemark}</textarea></td>
				</tr>
				<tr>
					<td class="bg" align="right">操作:</td>
					<td colspan="3"><input type="submit" value="保存"
						class="btn_auto_30 btn_blue" /><span class="red fs14  ml10">(提示：请先点击【保存】按钮，再审核该单据！)</span></td>
				</tr>
				<tr>
				<td class="bg" align="right"></td>
					<td>
						<a href="<@url value='/payment/upload?referId=${zXPTCWForm.referId}'/>" target="_blank">补充附件</a>
					</td>
					</tr>
			</tbody>
		</table>
		</div>
	</form>
	</div>
	
<@js>
//月平均提货总额
function onchangeTakeAmount(){
	var firstTakeAmount=$("#firstTakeAmount").val()*1;
	var secondTakeAmount=$("#secondTakeAmount").val()*1;
	var thirdTakeAmount=$("#thirdTakeAmount").val()*1;
	var fourthTakeAmount=$("#fourthTakeAmount").val()*1;
	var fifthTakeAmount=$("#fifthTakeAmount").val()*1;
	var sixthTakeAmount =$("#sixthTakeAmount").val()*1;
	var firstPaymentAmount=$("#firstPaymentAmount").val()*1;
	var recfirst;
	if(firstPaymentAmount<0){
		recfirst=firstTakeAmount+firstPaymentAmount;
		$("#firstRecAmount").val(recfirst.toFixed(2));
	}else{
		recfirst=firstTakeAmount-firstPaymentAmount;
		$("#firstRecAmount").val(recfirst.toFixed(2));
	}
	var secondPaymentAmount=$("#secondPaymentAmount").val()*1;
	var recSecond;
	if(secondPaymentAmount<0){
		recSecond=secondTakeAmount+secondPaymentAmount;
		$("#secondRecAmount").val(recSecond.toFixed(2));
	}else{
		recSecond=secondTakeAmount-secondPaymentAmount;
		$("#secondRecAmount").val(recSecond.toFixed(2));
	}
	var thirdPaymentAmount=$("#thirdPaymentAmount").val()*1;
	var recThird;
	if(thirdPaymentAmount<0){
		recThird=thirdTakeAmount+thirdPaymentAmount;
		$("#thirdRecAmount").val(recThird.toFixed(2));
	}else{
		recThird=thirdTakeAmount-thirdPaymentAmount;
		$("#thirdRecAmount").val(recThird.toFixed(2));
	}
	var fourthPaymentAmount=$("#fourthPaymentAmount").val()*1;
	var recFour;
	if(fourthPaymentAmount<0){
		recFour=fourthTakeAmount+fourthPaymentAmount;
		$("#fourthRecAmount").val(recFour.toFixed(2));
	}else{
		recFour=fourthTakeAmount-fourthPaymentAmount;
		$("#fourthRecAmount").val(recFour.toFixed(2));
	}
	var fifthPaymentAmount=$("#fifthPaymentAmount").val()*1;
	var recFifth;
	if(fifthPaymentAmount<0){
		recFifth=fifthTakeAmount+fifthPaymentAmount;
		$("#fifthRecAmount").val(recFifth.toFixed(2));
	}else{
		recFifth=fifthTakeAmount-fifthPaymentAmount;
		$("#fifthRecAmount").val(recFifth.toFixed(2));
	}
	var sixthPaymentAmount=$("#sixthPaymentAmount").val()*1;
	var recSix;
	if(sixthPaymentAmount<0){
		recSix=sixthTakeAmount+sixthPaymentAmount;
		$("#sixRecAmount").val(recSix.toFixed(2));
	}else{
		recSix=sixthTakeAmount-sixthPaymentAmount;
		$("#sixRecAmount").val(recSix.toFixed(2));
	}
	var takeAvgAmount=firstTakeAmount+secondTakeAmount+thirdTakeAmount+fourthTakeAmount+fifthTakeAmount+sixthTakeAmount;
	var takeAmount=(takeAvgAmount/6).toFixed(2);
	var paymentAmount=$("#paymentAvgAmount").val();
	$("#takeAvgAmount").val(takeAmount);
}
//月平均回款金额
function onchangePaymentAmount(){
	var firstTakeAmount=$("#firstTakeAmount").val()*1;
	var secondTakeAmount=$("#secondTakeAmount").val()*1;
	var thirdTakeAmount=$("#thirdTakeAmount").val()*1;
	var fourthTakeAmount=$("#fourthTakeAmount").val()*1;
	var fifthTakeAmount=$("#fifthTakeAmount").val()*1;
	var sixthTakeAmount =$("#sixthTakeAmount").val()*1;
	
	var firstPaymentAmount=$("#firstPaymentAmount").val()*1;
	var recfirst;
	if(firstPaymentAmount<0){
		recfirst=firstTakeAmount+firstPaymentAmount;
		$("#firstRecAmount").val(recfirst.toFixed(2));
	}else{
		recfirst=firstTakeAmount-firstPaymentAmount;
		$("#firstRecAmount").val(recfirst.toFixed(2));
	}
	var secondPaymentAmount=$("#secondPaymentAmount").val()*1;
	var recSecond;
	if(secondPaymentAmount<0){
		recSecond=secondTakeAmount+secondPaymentAmount;
		$("#secondRecAmount").val(recSecond.toFixed(2));
	}else{
		recSecond=secondTakeAmount-secondPaymentAmount;
		$("#secondRecAmount").val(recSecond.toFixed(2));
	}
	var thirdPaymentAmount=$("#thirdPaymentAmount").val()*1;
	var recThird;
	if(thirdPaymentAmount<0){
		recThird=thirdTakeAmount+thirdPaymentAmount;
		$("#thirdRecAmount").val(recThird.toFixed(2));
	}else{
		recThird=thirdTakeAmount-thirdPaymentAmount;
		$("#thirdRecAmount").val(recThird.toFixed(2));
	}
	var fourthPaymentAmount=$("#fourthPaymentAmount").val()*1;
	var recFour;
	if(fourthPaymentAmount<0){
		recFour=fourthTakeAmount+fourthPaymentAmount;
		$("#fourthRecAmount").val(recFour.toFixed(2));
	}else{
		recFour=fourthTakeAmount-fourthPaymentAmount;
		$("#fourthRecAmount").val(recFour.toFixed(2));
	}
	var fifthPaymentAmount=$("#fifthPaymentAmount").val()*1;
	var recFifth;
	if(fifthPaymentAmount<0){
		recFifth=fifthTakeAmount+fifthPaymentAmount;
		$("#fifthRecAmount").val(recFifth.toFixed(2));
	}else{
		recFifth=fifthTakeAmount-fifthPaymentAmount;
		$("#fifthRecAmount").val(recFifth.toFixed(2));
	}
	var sixthPaymentAmount=$("#sixthPaymentAmount").val()*1;
	var recSix;
	if(sixthPaymentAmount<0){
		recSix=sixthTakeAmount+sixthPaymentAmount;
		$("#sixRecAmount").val(recSix.toFixed(2));
	}else{
		recSix=sixthTakeAmount-sixthPaymentAmount;
		$("#sixRecAmount").val(recSix.toFixed(2));
	}
	var paymentAvgAmount=firstPaymentAmount+secondPaymentAmount+thirdPaymentAmount+fourthPaymentAmount+fifthPaymentAmount+sixthPaymentAmount
	var paymentAmount=(paymentAvgAmount/6).toFixed(2);
	$("#paymentAvgAmount").val(paymentAmount);
	var takeAmount=$("#takeAvgAmount").val();
}
</@js>
<@jsRender/>
</div>